import { useState, useEffect } from "react";

const useList = () => {
  const [list, setList] = useState([]);
  useEffect(() => {
    fetch("http://www.pudge.wang:3080/api/mapdata")
      .then((response) => response.json())
      .then((res) => {
        console.log(res);
        setList(res.features);
      });
  }, []);

  return list;
};

export default useList;
